package com.owc.domain.dto.admin;

import com.owc.common.converter.OutputConverter;
import com.owc.common.enums.ClientEnum;
import com.owc.domain.entity.Version;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author Jackies
 * @Date 2019/12/18 23:06
 * @Description TODO://
 **/
@NoArgsConstructor
@Data
public class VersionDTO implements OutputConverter<VersionDTO, Version> {
	private Long id;
	private String version;
	private String notice;
	private Integer type;
	private String system;
	private String updateTime;
	private String download;

	@Override
	public void customConverter(VersionDTO versionDTO, Version version) {
		versionDTO.setNotice(version.getContent());
		versionDTO.setSystem(ClientEnum.match(version.getSystemType()).get().getDesc());
		versionDTO.setType(version.getForce());
		versionDTO.setUpdateTime(version.getCreateTime());
		versionDTO.setDownload(version.getDownload());
	}
}
